//
//  ShowViewRegisterCell.swift
//  iModern
//
//  Created by Ralf on 7/29/15.
//  Copyright (c) 2015 com.starlooking. All rights reserved.
//

import UIKit

class ShowViewRegisterCell: TableViewCell
{

    @IBOutlet weak var headImageView: UIImageView!
    @IBOutlet weak var nameLabel:     UILabel!
    @IBOutlet weak var addressLabel:  UILabel!

    override func awakeFromNib()
    {
        super.awakeFromNib()
    }
    
    func setData(address: String,shopName: String)
    {
        self.headImageView.layer.masksToBounds = true
        self.headImageView.layer.cornerRadius = self.headImageView.frame.size.width / 2
        //        self.headImageView.layer.borderWidth=1.0
        
        //        self.nameLabel.text = appDelegate.contactManager.contact["shopName"] as? String
        //        var address = appDelegate.contactManager.contact["address"] as? String
        self.nameLabel.text = shopName
        let address = "匠铺地址：" + address
        self.addressLabel.text = address
        
        let imageURL = appDelegate.contactManager.contact["shopLogoURL"] as? String
        
        if (imageURL != nil)
        {
            self.headImageView.load(appDelegate.parameterManager.server + "/" + imageURL!, placeholder: nil)
        }
        else
        {
            self.headImageView.image = UIImage(named: "Avatar-Default.png")
        }
    }

    override func setSelected(selected: Bool, animated: Bool)
    {
        super.setSelected(selected, animated: animated)

    }

}
